import { axios } from '@/utils/request'

// 可选商品
// page
// goods_name
// limit
export function frontAgentGoodsList(params) {
  return axios({
    url: '/agent/agent-bind/front-agent-goods-list',
    method: 'get',
    params,
  })
}

// 绑定商品
// cloud_goods_id
// admin_id
export function bindFrontAgentGoods(data) {
  return axios({
    url: '/agent/agent-bind/bind-front-agent-goods',
    method: 'post',
    data,
  })
}

// 已经绑定的产品列表
// status
// goods_name
// admin_name
// supplier_name
export function getBindGoodsList(params) {
  return axios({
    url: '/agent/agent-bind/get-bind-goods-list',
    method: 'get',
    params,
  })
}

// 删除绑定产品
// status
// goods_name
export function delBindFrontAgentGoods(params) {
  return axios({
    url: '/agent/agent-bind/del-bind-front-agent-goods',
    method: 'get',
    params,
  })
}

// 审核绑定产品
// id
// status
export function applyBindFrontAgentGoods(data) {
  return axios({
    url: '/agent/agent-bind/apply-bind-front-agent-goods',
    method: 'post',
    data,
  })
}

export function getInstallLog(params) {
  return axios({
    url: '/agent/agent-bind/get-install-log',
    method: 'get',
    params,
  })
}

// 获取产品代理设置
export function getGoodsAgentPriceConfig() {
  return axios({
    url: '/saas/goods-agent-price-config',
    method: 'get',
  })
}

// 设置产品代理设置
export function setGoodsAgentPriceConfig(data) {
  return axios({
    url: '/saas/goods-agent-price-config',
    method: 'post',
    data,
  })
}

// 获取推广代理设置
export function getBdAgencyPriceConfig() {
  return axios({
    url: '/saas/bd-agency-price-config',
    method: 'get',
  })
}

// 设置推广代理设置
export function setBdAgencyPriceConfig(data) {
  return axios({
    url: '/saas/bd-agency-price-config',
    method: 'post',
    data,
  })
}

// 推广代理登陆
export function generateTokenByBdAgent(data) {
  return axios({
    url: '/auth/generate-token-by-bd-agent',
    method: 'post',
    data,
  })
}

// 送达
export function setInstallStatus(params) {
  return axios({
    url: '/agent/agent-bind/set-install-status',
    method: 'get',
    params,
  })
}

export function setAgentGoodsPercent(data) {
  return axios({
    url: '/cloud/platform/set-agent-goods-percent',
    method: 'post',
    data,
  })
}
